import Router from 'vue-router'

import routes from './routes.js'

export default () => {
    return new Router({
        routes,
        mode: 'history',
        // base: '/base/',
        scrollBehavior(to, from, savedPosition) {
            if (savedPosition) {
                return savedPosition
            } else {
                return { x: 0, y: 0 }
            }
        },
        // url上面的query的参数
        // parseQuery(query) {},
        // stringifyQuery(obj) {},
        // fallback: true // default:true
    })
}